package cn.lystudio.rohmtimeopwide_background_v11.service.impl;

import cn.lystudio.rohmtimeopwide_background_v11.entity.po.USMQrTypePO;
import cn.lystudio.rohmtimeopwide_background_v11.mapper.USMQrTypePOMapper;
import cn.lystudio.rohmtimeopwide_background_v11.service.USMQrTypeService;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Slf4j
@DS("master")

public class USMQrTypeServiceImpl implements USMQrTypeService {
    @Resource
    private USMQrTypePOMapper usmQrTypePOMapper;
    @Override
    public USMQrTypePO getUSMQrType() {
        LambdaQueryWrapper<USMQrTypePO> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(USMQrTypePO::getQrTypeID, 1)
                .last("LIMIT 1");
        return usmQrTypePOMapper.selectOne(wrapper);
    }

    @Override
    public USMQrTypePO getUSMChipQRType() {
        LambdaQueryWrapper<USMQrTypePO> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(USMQrTypePO::getQrTypeID, 2)
                .last("LIMIT 1");
        return usmQrTypePOMapper.selectOne(wrapper);
    }
}
